

unsigned short conv_swap8(unsigned short u16)
{
    unsigned short msb = (u16 & 0xff);
    unsigned short lsb = (u16 >> 8) & 0xff;

    return (msb << 8) | lsb;
}

void conv_swap8_self(unsigned short *u16)
{
    unsigned short msb = (*u16 & 0xff);
    unsigned short lsb = (*u16 >> 8) & 0xff;

    *u16 = (msb << 8) | lsb;
}
